/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meanzoft.m3d.scene.camera;

import org.lwjgl.util.glu.GLU;
import org.lwjgl.util.vector.Vector3f;
import org.meanzoft.m3d.scene.SceneNode;
import static org.lwjgl.opengl.GL11.*;

/**
 *
 * @author Meanz
 */
public class ChaseCamera extends Camera {

    private Vector3f target;

    public ChaseCamera() {
        target = new Vector3f(0f, 0f, 0f);
    }

    public void setTarget(Vector3f target) {
        if (target == null) {
            return;
        }
        this.target = target;
    }

    public void updateRender() {
        glRotatef(-getPitch(), 1.0f, 0.0f, 0.0f);
        glRotatef(getYaw(), 0.0f, 1.0f, 0.0f);
        glTranslatef(-position.x - 0.5f, -position.y, -position.z);
    }
}
